#ifndef _MESH_H_
#define _MESH_H_

#include <WinDef.h>

#include <vector>

#include <D3D10_1.h>
#include <D3D11.h>
#include <D3DX10math.h>

#include <assimp/mesh.h>

#include "Core\IndexBuffer.h"
#include "Core\VertexBuffer.h"
#include "Scene\Material.h"

class Mesh
{
public:
	Mesh();
	~Mesh();

	BOOL build(aiMesh* ai_mesh,UINT interval,Material* material,VertexBuffer* vertex_buffer);

	CONST std::vector<UINT>& indexes() CONST;

	CONST D3DXVECTOR3 center() CONST;
	VOID setCenter(D3DXVECTOR3 center);

	IndexBuffer* GetIndexBuffer() const;
	VertexBuffer* GetVertexBuffer() const;
	Material* GetMaterial() const;

private:
	BOOL              m_is_empty;

	D3DXVECTOR3       m_center_position;

	std::vector<UINT> m_indexes;

	IndexBuffer*      m_index_buffer;
	VertexBuffer*     m_vertex_buffer;

	Material*         m_material;
};

#endif

